"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
const fs = __importStar(require("fs"));
const path_1 = __importDefault(require("path"));
const lib_css_1 = __importDefault(require("../../../../../../@libs/nodejs-lib-main/lib_css"));
const role_dialog_1 = __importDefault(require("../PropertyCompoents/role_dialog/role_dialog"));
const location_dialog_1 = __importDefault(require("../PropertyCompoents/location_dialog/location_dialog"));
const component = {
    components: { RoleDialog: role_dialog_1.default, LocDialog: location_dialog_1.default },
    template: fs.readFileSync(`${__dirname}/fight_property.html`, "utf-8"),
    name: '',
    props: {
        treeData: "",
        nodeData: Object,
        lf: Object || String,
    },
    mounted() {
        lib_css_1.default.load([
            {
                parent: this.$el,
                url_s: path_1.default.join(`${__dirname}/fight_property.css`),
            },
        ]);
        const { properties, text } = this.$props.nodeData;
        if (properties) {
            this.$data.formData = Object.assign({}, this.$data.formData, properties);
            console.log("this.$data.formData88", this.$data.formData);
        }
        if (text && text.value) {
            this.$data.formData.graphRes_title = text.value;
        }
        if (text && text.value) {
            this.$data.text = text.value;
        }
    },
    methods: {
        onSubmit() {
            const { properties, id } = this.$props.nodeData;
            let newFight = this.$data.formData;
            this.$props.lf.setProperties(id, Object.assign({}, newFight));
            let newloo = this.$props.lf.getProperties(id);
            this.$props.lf.updateText(id, this.$data.formData.graphRes_title);
        },
    },
    data() {
        return {
            mouse: {
                left: 0,
                top: 0
            },
            text: '',
            formData: {
                graphRes_title: '',
                fightList: '', //战斗列表
            }
        };
    },
    watch: {},
    created() { },
};
module.exports = component;
